//
//  MainTabBarViewController.m
//  Lucode
//
//  Created by lanou3g on 15/10/13.
//  Copyright © 2015年 liudi. All rights reserved.
//

#import "MainTabBarViewController.h"
#import "HomePageViewController.h"
#import "HeroViewController.h"
#import "KnoledgeViewController.h"
#import "MineViewController.h"
#import "WMPageController.h"

#import "HeadLineVC.h"
#import "VideoVC.h"
#import "MatchVC.h"
#import "BeautyVC.h"
#import "JiongVC.h"
#import "PictureVC.h"

@interface MainTabBarViewController ()

@end

@implementation MainTabBarViewController

-(instancetype)init
{
    if (self = [super init]) {
        NSArray * homeControllers  = [NSArray arrayWithObjects:[HeadLineVC class],[VideoVC class],[MatchVC class],[BeautyVC class],[JiongVC class],[PictureVC class], nil];
        NSArray * titleArray = [NSArray arrayWithObjects:@"首页",@"视频",@"比赛",@"美女",@"囧图",@"壁纸", nil];
        
        WMPageController * homepage = [[WMPageController alloc]initWithViewControllerClasses:homeControllers andTheirTitles:titleArray];
        homepage.menuItemWidth = self.view.frame.size.width / titleArray.count;
        homepage.menuBGColor = [UIColor grayColor];
        homepage.menuViewStyle = WMMenuViewStyleFooldHollow;
        homepage.title = @"首页";
        
        HeroViewController * hero = [[HeroViewController alloc]init];
        UINavigationController * heroNAV = [[UINavigationController alloc]initWithRootViewController:hero];
        KnoledgeViewController * knoledge = [KnoledgeViewController new];
        UINavigationController * knoledgeNAV = [[UINavigationController alloc]initWithRootViewController:knoledge];
        MineViewController * mine = [MineViewController new];
        UINavigationController * mineNAV = [[UINavigationController alloc]initWithRootViewController:mine];
        UINavigationController * naVC = [[UINavigationController alloc]initWithRootViewController:homepage];
        NSArray * viewControllers = [NSArray arrayWithObjects:naVC,heroNAV,knoledgeNAV,mineNAV, nil];
        self.viewControllers = viewControllers;
        self.selectedIndex = 0;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
